<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" href="/mdui/css/mdui.min.css">
    <script defer src="/mdui/js/mdui.min.js"></script>
    <script src="/js/axios.min.js"></script>
    <script src="/js/qs.min.js"></script>
    <script src="/js/common.js"></script>
    <script src="/js/vue.js"></script>
    <style>
        .mdui-table {
            border: 1px solid #d6d6d6;
        }

        a {
            text-decoration: none;
        }

        .mdui-table td img {
            height: 100px;
            width: 140px;
        }
    </style>
</head>
<div id="app">
    <h3>报修单编号{{repair.id}}</h3>
    <button class="mdui-btn mdui-color-green-800 mdui-ripple"><a href="accomplish .html"
                                                                 class=" mdui-color-green-800">返回上一级</a>
    </button>
    <table class="mdui-table">
        <thead>
        <tr>
            <th>特征</th>
            <th>描述</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>地点</td>
            <td>{{repair.place}}</td>
        </tr>
        <tr>
            <td>时间</td>
            <td>{{repair.submitTime}}</td>
        </tr>
        <tr>
            <td>状态</td>
            <td>{{repair.status |fmtGenter}}</td>
        </tr>
        <tr>
            <td>详情</td>
            <td>{{repair.detail}}</td>
        </tr>
        <tr>
            <td>图片</td>
            <td class="img-hight"><img :src="'/repair/downlode/' + repair.id">

            </td>
        </tr>
        </tbody>
    </table>
</div>
</div>
<script>
    let params = new URLSearchParams(location.search);//location.searc url中参数的部分包括问号
    let repairid = params.get("id")
    new Vue({
        el: '#app',
        data: {
            repair: {
                id: '',
                status: "",
                detail: "",
                place: "",
                picMD5: "",
                submitTime: ""
            },
        },
        created() {
            let _this = this
            axios.get("/repair/findById?id=" + repairid)
                .then(function (res) {
                    _this.repair = res.data;
                    console.log(res.data)
                })
        },
        filters: {
            fmtGenter(val) {
                if (val == 1) {
                    return "未安排维修维修"
                } else if (val == 2) {
                    return "已安排检修"
                } else if (val == 3) {
                    return "待同意取消"
                } else if (val == 4) {
                    return "已同意取消"
                } else if (val == 5) {
                    return "待验收"
                } else if (val == 6) {
                    return "已验收"
                }
            }
        },

    })

</script>
</body>
</html>